package com.rong.shop.mapper;

import com.rong.shop.pojo.Cart;
import com.rong.shop.pojo.vo.CartVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface CartMapper {

    Cart findByUidAndPid(@Param("uid") Integer uid, @Param("pid") Integer pid);

    List<CartVO> findByUid(@Param("uid") Integer uid);

    List<CartVO> findByCids(Integer[] cids);

    Cart findByCid(@Param("cid") Integer cid);

    Integer insert(Cart cart);

    Integer updateNumByCid(@Param("cid") Integer cid, @Param("num") Integer num,
                           @Param("modifiedUser") String modifiedUser,
                           @Param("modifiedTime") Date modifiedTime);


}
